package cn.edu.scau.cmi.wuzewei.composite.consistent;

import java.util.Map;

public class ConsistentLeaf implements ConsistentComponent {
	public String name;
	
	@Override
	public String doSomething() {

		return null;
	}
	
	@Override
	public String toString() {
		return name;
	}

	ConsistentComponent parentComponent;

	public ConsistentLeaf(ConsistentComponent parentComponent, String myname) {
		this.parentComponent = parentComponent;
		name = myname;
	}

	@Override
	public void addChild(String name, ConsistentComponent parentComponent) {
		System.out.println("对不起，叶节点不能添加子节点");
	}

	@Override
	public void delete(String child) {
		System.out.println("对不起，叶节点没有子节点，不能删除子节点");

	}

	@Override
	public void updateChildren(Map<String, ConsistentComponent> mapChildren) {

	}

	@Override
	public ConsistentComponent getParent() {

		return null;
	}

	@Override
	public Map<String, ConsistentComponent> getChileren() {

		return null;
	}

}
